package com.company.Sort;

/**
 * Created by v on 16-12-9.
 */
public class InsertionSort {
    public static<E extends Comparable<E>> void insertionSort(E[] e){

        for(int i=1;i<e.length;i++){
            E temp=e[i];
            int j;
            for(j=i;j>0&&temp.compareTo(e[j-1])<0;j--){
                e[j]=e[j-1];
            }
            e[j]=temp;
        }
    }
}
